package PpLocator;
# by Tao Lang: langtao123xxx@126.com
use Mojo::Base 'Mojolicious';

# This method will run once at server start
sub startup {
  my $self = shift;

  # Load configuration from hash returned by config file
  my $config = $self->plugin('Config');

  # Configure the application
  $self->secrets($config->{secrets});

  # Router
  my $r = $self->routes;

  $r->get('/')->to('home#index');

  # PP-Locator
  $r->get('/pp_locator')->to('pp_locator#index');
  $r->get('/pp_locator/chromosome')->to('pp_locator#chromosome');
  $r->get('/pp_locator/chrlen')->to('pp_locator#chr_len');
  $r->post('/pp_locator/blastn')->to('pp_locator#blastn');
  $r->get('/pp_locator/job_status')->to('pp_locator#job_status');
  $r->get('/pp_locator/plot')->to('pp_locator#plot');
  $r->get('/pp_locator/about')->to('pp_locator#about');
  $r->get('/pp_locator/help')->to('pp_locator#help');
  $r->get('/pp_locator/contact')->to('pp_locator#contact');
  $r->get('/pp_locator/update_log')->to('pp_locator#update_log');
  $r->get('/pp_locator/data_source')->to('pp_locator#data_source');
  $r->get('/pp_locator/blastdbcmd')->to('pp_locator#blastdbcmd');

}

1;
